<template>
  <el-card class="box-card">
    <template #header>
      <div class="card-header">
        <span>首页</span>
      </div>
    </template>
      <div class="box">
        <div class="top-card-left">
          <div class="top-card-left-title">早安，管理员，请开始一天的工作吧</div>
          <div class="top-card-left-dot">{{ weatherInfo }}</div>
          <div class="top-card-left-rows">
            <el-row>
              <el-col :span="8" :xs="24" :sm="8">
                <div class="flex-center">
                  <el-icon class="dashboard-icon">
                    <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa=""><path fill="currentColor" d="M384 96a32 32 0 0 1 64 0v786.752a32 32 0 0 1-54.592 22.656L95.936 608a32 32 0 0 1 0-45.312h.128a32 32 0 0 1 45.184 0L384 805.632V96zm192 45.248a32 32 0 0 1 54.592-22.592L928.064 416a32 32 0 0 1 0 45.312h-.128a32 32 0 0 1-45.184 0L640 218.496V928a32 32 0 1 1-64 0V141.248z"></path></svg>
                  </el-icon>
                  今日流量 (1231231)
                </div>
              </el-col>
              <el-col :span="8" :xs="24" :sm="8">
                <div class="flex-center">
                  <el-icon class="dashboard-icon">
                    <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa=""><path fill="currentColor" d="M628.736 528.896A416 416 0 0 1 928 928H96a415.872 415.872 0 0 1 299.264-399.104L512 704l116.736-175.104zM720 304a208 208 0 1 1-416 0 208 208 0 0 1 416 0z"></path></svg>
                  </el-icon>
                  总用户数 (24001)
                </div>
              </el-col>
              <el-col :span="8" :xs="24" :sm="8">
                <div class="flex-center">
                  <el-icon class="dashboard-icon">
                    <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa=""><path fill="currentColor" d="M736 504a56 56 0 1 1 0-112 56 56 0 0 1 0 112zm-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112zm-224 0a56 56 0 1 1 0-112 56 56 0 0 1 0 112zM128 128v640h192v160l224-160h352V128H128z"></path></svg>
                  </el-icon>
                  好评率 (99%)
                </div>
              </el-col>
            </el-row>
          </div>
          <div>
            <div class="top-card-left-item">
              使用教学：
              <a
                style="color:#409EFF"
                target="view_window"
                href="https://www.baidu.com"
              >https://www.baidu.com</a>
            </div>
            <div class="top-card-left-item">
              代码仓库：
              <a
                style="color:#409EFF"
                target="view_window"
                href="https://gitee.com/tag-dragon/performance-management-system"
              >https://gitee.com/tag-dragon/performance-management-system</a>
            </div>
          </div>
        </div>
        <img src="@/assets/dashboard.png" class="top-card-right" alt="">
      </div>
  </el-card>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { useWeatherInfo } from './weather.js'
export default defineComponent({
  setup() {
    const weatherInfo = useWeatherInfo()
    return {
      weatherInfo
    }
  }
})
</script>

<style lang="scss" scoped>
.flex-center {
    display: flex;
    align-items: center;
}
.box-card {
  .card-header{
    text-align: left;
  }
  .box {
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #777;
    text-align: left;
    .top-card-left{
      height: 100%;
      display: flex;
      flex-direction: column;
      .top-card-left-title{
        font-size: 22px;
        color: #343844;
      }
      .top-card-left-dot{
        font-size: 16px;
        color: #6b7687;
        margin-top: 28px;
      }
      .top-card-left-rows{
        margin-top: 22px;
        color: #6b7687;
        width: 600px;
        align-items: center;
        .el-row {
          padding: 20px 0;
          .dashboard-icon{
            font-size: 20px;
            color: #55a0f8;
            width: 30px;
            height: 30px;
            margin-right: 10px;
            display: flex;
            align-items: center;
          }
        }
      }
      .top-card-left-item{
        margin-top: 18px;
      }
    }
    .top-card-right{
      height: 600px;
      width: 600px;
      margin-top: 40px;
    }
  }
}
</style>